home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / 2924.ZIP / DMLXREF.ARC / KBD.DOC < prev    next >
Encoding:
Text File  |  1988-12-28  |  9.6 KB  |  436 lines

  1. .KF:kbd.toc
  2. .R:E
  3. .W:96
  4. .H:...DML KBD UNIT Version 1.00...
  5. .H:...$$Day Mon D, YEAR$$  $$Z:MI A.M.$$     Page $$$...
  6. .H:
  7. .F:
  8. .F:... Copyright (c) 1989, by DML Software Inc. ...
  9. .X:8
  10.  
  11. .K:KEYBOARD ROUTINES - CHANGES HIGHLIGHTS (VERSION 1.00)
  12. KEYBOARD ROUTINES - CHANGES HIGHLIGHTS (VERSION 1.00)
  13.  
  14. 1/1/89 Initial Release
  15.  
  16. 
  17.  
  18. .K:1) GENERAL PURPOSE KEYBOARD
  19. 1) GENERAL PURPOSE KEYBOARD
  20.  
  21.   NAME
  22. .K:KbdGetStatus - Gets the Keyboard status flags.
  23.     KbdGetStatus - Gets the Keyboard status flags.
  24.  
  25.   SYNOPSIS
  26.     FUNCTION KbdGetStatus : WORD;
  27.  
  28.     WRITELN('All the keyboard flags: ',W2S(KbdGetStatus,'HHHH'));
  29.      
  30.   DESCRIPTION
  31.      This function returns the keyboard shift status in the record of
  32.      booleans describing each status.  The record structure is defined in
  33.      root.xxx. The value of the function is an integer, the 16 bits of
  34.      which describe which status is TRUE.  The keyboard status is returned
  35.      by accessing the two key-board flag bytes within the BIOS
  36.      communication area. The possible bit settings are:
  37.  
  38.              Bit Position     Description
  39.              ------------     --------------------------
  40.                   15          Insert state is active
  41.                   14          Caps Lock key toggled
  42.                   13          Num Lock key toggled
  43.                   12          Scroll Lock key toggled
  44.                   11          Alt shift key depressed
  45.                   10          Ctrl shift depressed
  46.                   09          Left shift key depressed
  47.                   08          Right shift depressed
  48.                   07          Ins key depressed
  49.                   06          Caps Lock key depressed
  50.                   05          Num Lock key depressed
  51.                   04          Scroll Lock depressed
  52.                   03          Suspend state toggled
  53.                   02          SysReq depressed & held (AT only)
  54.                   01          Not Used
  55.                   00          Not Used
  56.  
  57.   SEE ALSO
  58.     KbdInsModeStatus, KbdCapsLockStatus, KbdNumLockStatus,
  59.     KbdScrollLockStatus
  60.  
  61.   DEPENDS ON
  62.  
  63.   DIAGNOSTICS
  64.  
  65.   KNOWN RESTRICTIONS
  66.  
  67.   PARTIALLY OBSOLETED BY 
  68.  
  69.   UPDATE HISTORY
  70.  
  71.   
  72.  
  73.   NAME
  74. .K:KbdSetInsMode - Sets the Insert Mode toggle.
  75.      KbdSetInsMode - Sets the Insert Mode toggle.
  76.  
  77.   SYNOPSIS
  78.      PROCEDURE KbdSetInsMode (InsMode : BOOLEAN);
  79.  
  80.      KbdSetInsMode (ON);
  81.  
  82.   DESCRIPTION
  83.      Two Boolean constants are defined in GEN: ON = TRUE and OFF = FALSE.  This 
  84.      routine is the equivalent of pressing the key manually on the keyboard. 
  85.  
  86.   SEE ALSO
  87.      KbdInsModeStatus
  88.  
  89.   DEPENDS ON
  90.  
  91.   DIAGNOSTICS
  92.  
  93.   KNOWN RESTRICTIONS 
  94.  
  95.   PARTIALLY OBSOLETED BY 
  96.  
  97.   UPDATE HISTORY
  98.  
  99.   
  100.  
  101.   NAME
  102. .K:KbdSetCapsLock - Sets the Caps Lock toggle.
  103.      KbdSetCapsLock - Sets the Caps Lock toggle.
  104.  
  105.   SYNOPSIS
  106.      PROCEDURE KbdSetCapsLock (CapsLock : BOOLEAN);
  107.  
  108.      KbdSetCapsLock (ON);
  109.  
  110.   DESCRIPTION
  111.      Two Boolean constants are defined in GEN: ON = TRUE and OFF = FALSE.  This 
  112.      routine is the equivalent of pressing the key manually on the keyboard. 
  113.  
  114.   SEE ALSO
  115.      KbdCapsLockStatus
  116.  
  117.   DEPENDS ON
  118.  
  119.   DIAGNOSTICS
  120.  
  121.   KNOWN RESTRICTIONS 
  122.  
  123.   PARTIALLY OBSOLETED BY 
  124.  
  125.   UPDATE HISTORY
  126.  
  127.   
  128.  
  129.   NAME
  130. .K:KbdSetNumLock - Sets the Number Lock toggle.
  131.      KbdSetNumLock - Sets the Number Lock toggle.
  132.  
  133.   SYNOPSIS
  134.      PROCEDURE KbdSetNumLock (NumLock : BOOLEAN);
  135.  
  136.      KbdSetNumLock (OFF);
  137.  
  138.   DESCRIPTION
  139.      Two Boolean constants are defined in GEN: ON = TRUE and OFF = FALSE.  This 
  140.      routine is the equivalent of pressing the key manually on the keyboard. 
  141.  
  142.   SEE ALSO
  143.      KbdNumLockStatus
  144.  
  145.   DEPENDS ON
  146.  
  147.   DIAGNOSTICS
  148.  
  149.   KNOWN RESTRICTIONS 
  150.  
  151.   PARTIALLY OBSOLETED BY 
  152.  
  153.   UPDATE HISTORY
  154.  
  155.   
  156.  
  157.   NAME
  158. .K:KbdSetScrollLock - Sets the Scroll Lock toggle.
  159.      KbdSetScrollLock - Sets the Scroll Lock toggle.
  160.  
  161.   SYNOPSIS
  162.      PROCEDURE KbdSetScrollLock (ScrollLock : BOOLEAN);
  163.  
  164.      KbdSetScrollLock (OFF);
  165.  
  166.   DESCRIPTION
  167.      Two Boolean constants are defined in GEN: ON = TRUE and OFF = FALSE.  This 
  168.      routine is the equivalent of pressing the key manually on the keyboard. 
  169.  
  170.   SEE ALSO
  171.     KbdScrollLockStatus
  172.  
  173.   DEPENDS ON
  174.  
  175.   DIAGNOSTICS
  176.  
  177.   KNOWN RESTRICTIONS 
  178.  
  179.   PARTIALLY OBSOLETED BY 
  180.  
  181.   UPDATE HISTORY
  182.  
  183.   
  184.  
  185.   NAME
  186. .K:KbdInsModeStatus - Returns the state of the Insert Mode toggle.
  187.      KbdInsModeStatus - Returns the state of the Insert Mode toggle.
  188.  
  189.   SYNOPSIS
  190.      FUNCTION KbdInsModeStatus : BOOLEAN;
  191.  
  192.      If KbdInsModeStatus THEN PrintMessage;
  193.  
  194.   DESCRIPTION
  195.      KbdInsModeStatus will have the value TRUE if the Insert toggle is on.
  196.  
  197.   SEE ALSO
  198.      KbdSetInsMode
  199.  
  200.   DEPENDS ON
  201.      KbdGetStatus
  202.  
  203.   DIAGNOSTICS
  204.  
  205.   KNOWN RESTRICTIONS 
  206.  
  207.   PARTIALLY OBSOLETED BY 
  208.  
  209.   UPDATE HISTORY
  210.  
  211.   
  212.  
  213.   NAME
  214. .K:KbdCapsLockStatus - Returns the state of the keyboard Caps Lock flag.
  215.     KbdCapsLockStatus - Returns the state of the keyboard Caps Lock flag.
  216.  
  217.   SYNOPSIS
  218.     FUNCTION KbdCapsLockStatus : BOOLEAN;
  219.  
  220.     IF KbdCapsLockStatus THEN PrintMessage;
  221.  
  222.   DESCRIPTION
  223.     KbdCapsLockStatus will have the value TRUE if the Caps Lock flag is on.
  224.  
  225.   SEE ALSO
  226.     KbdSetCapsLock
  227.  
  228.   DEPENDS ON
  229.     KbdGetStatus
  230.  
  231.   DIAGNOSTICS
  232.  
  233.   KNOWN RESTRICTIONS 
  234.  
  235.   PARTIALLY OBSOLETED BY 
  236.  
  237.   UPDATE HISTORY
  238.  
  239.   
  240.  
  241.   NAME
  242. .K:KbdNumLockStatus - Returns the state of the Number lock flag.
  243.      KbdNumLockStatus - Returns the state of the Number lock flag.
  244.  
  245.   SYNOPSIS
  246.      FUNCTION KbdNumLockStatus : BOOLEAN;
  247.  
  248.      IF KbdNumLockStatus THEN PrintMessage;
  249.  
  250.  
  251.   DESCRIPTION
  252.      KbdNumLockStatus will have the value TRUE if the Number Lock flag is on.
  253.  
  254.   SEE ALSO
  255.      KbdSetNumLock
  256.  
  257.   DEPENDS ON
  258.      KbdGetStatus
  259.  
  260.   DIAGNOSTICS
  261.  
  262.   KNOWN RESTRICTIONS 
  263.  
  264.   PARTIALLY OBSOLETED BY 
  265.  
  266.   UPDATE HISTORY
  267.  
  268.   
  269.  
  270.   NAME
  271. .K:KbdScrollLockStatus - Returns the state of the Scroll lock flag.
  272.      KbdScrollLockStatus - Returns the state of the Scroll lock flag.
  273.  
  274.   SYNOPSIS
  275.      FUNCTION KbdScrollLockStatus : BOOLEAN;
  276.  
  277.      If KbdScrollLockStatus THEN PrintMessage;
  278.  
  279.   DESCRIPTION
  280.      KbdScrollLockStatus will have the value TRUE if Scroll lock is on.
  281.  
  282.   SEE ALSO
  283.      KbdSetScrollLock
  284.  
  285.   DEPENDS ON
  286.      KbdGetStatus
  287.  
  288.   DIAGNOSTICS
  289.  
  290.   KNOWN RESTRICTIONS 
  291.  
  292.   PARTIALLY OBSOLETED BY 
  293.  
  294.   UPDATE HISTORY
  295.  
  296.   
  297.  
  298. .K:2) KEYBOARD BUFFER
  299. 2) KEYBOARD BUFFER
  300.  
  301.   NAME
  302. .K:KbdClear - Clears the keyboard buffer.
  303.     KbdClear - Clears the keyboard buffer.
  304.  
  305.   SYNOPSIS
  306.     PROCEDURE KbdClear;
  307.  
  308.     REPEAT
  309.       UNTIL KeyPressed;
  310.     KbdClear;
  311.  
  312.   DESCRIPTION
  313.     This procedure flushes the keyboard buffer, that is, all remaining
  314.     keystrokes are removed from the buffer.  It does no damage to flush an
  315.     empty buffer.  The buffer is flushed by making a call to DOS function 0C
  316.     (hex).
  317.  
  318.   SEE ALSO
  319.  
  320.   DEPENDS ON
  321.  
  322.   DIAGNOSTICS
  323.  
  324.   KNOWN RESTRICTIONS 
  325.  
  326.   PARTIALLY OBSOLETED BY 
  327.  
  328.   UPDATE HISTORY
  329.  
  330.   
  331.  
  332.   NAME
  333. .K:KbdNumValuesWaiting - Returns the number of keys waiting in the keyboard.
  334.      KbdNumValuesWaiting - Returns the number of keys waiting in the keyboard
  335.                            buffer.
  336.  
  337.   SYNOPSIS
  338.      FUNCTION KbdNumValuesWaiting : INTEGER;
  339.  
  340.      IF KbdNumValuesWaiting > 10 THEN ReadKeyboard;
  341.  
  342.   DESCRIPTION
  343.      The BIOS does not support this function.  The data locations for the head
  344.      and tail pointers for the keyboard buffer are known, and the number of keys
  345.      in the buffer is calculated from them.
  346.  
  347.   SEE ALSO
  348.  
  349.   DEPENDS ON
  350.  
  351.   DIAGNOSTICS
  352.  
  353.   KNOWN RESTRICTIONS 
  354.  
  355.   PARTIALLY OBSOLETED BY 
  356.  
  357.   UPDATE HISTORY
  358.  
  359.   
  360.  
  361.   NAME
  362. .K:KbdInputValue - Waits for and returns "scan code" of a key pressed.
  363.     KbdInputValue - Waits for and returns "scan code" of a key pressed.
  364.  
  365.   SYNOPSIS
  366.     FUNCTION KbdInputValue : WORD;
  367.     VAR
  368.       KbdLastChar : CHAR;
  369.  
  370.     CASE KbdInputValue OF
  371.       K_Esc    : Abort;
  372.       'A'..'Z' : WRITELN ('You pressed: ', KbdLastChar);
  373.       END;
  374.  
  375.   DESCRIPTION
  376.     KbdInputValue will wait for a key to be pressed.  If you don't want to
  377.     wait it is suggested that you use KbdKeyWaiting in a repeat loop before
  378.     you call this procedure.  The value returned will simply be the ASCII
  379.     value unless a special key (Function keys, cursor, etc) was pressed in
  380.     which case the returned value will be 256 plus the IBM extended code.
  381.     Included in this file are constant values for all the unique special
  382.     keys allowed by the BIOS.  In addition, there is a special initialized
  383.     constant called KbdLastChar which contains the last normal key pressed.
  384.     If the last key pressed was a special key then KbdLastChar will contain
  385.     the value zero.
  386.  
  387.   SEE ALSO
  388.     KbdKeyWaiting
  389.  
  390.   DEPENDS ON
  391.  
  392.   DIAGNOSTICS
  393.  
  394.   KNOWN RESTRICTIONS 
  395.  
  396.   PARTIALLY OBSOLETED BY
  397.      ReadKey
  398.  
  399.   UPDATE HISTORY
  400.  
  401.   
  402.  
  403.   NAME
  404. .K:KbdKeyWaiting - Returns TRUE if a key is in the keyboard buffer.
  405.      KbdKeyWaiting - Returns TRUE if a key is in the keyboard buffer.
  406.  
  407.   SYNOPSIS
  408.      FUNCTION KbdKeyWaiting : BOOLEAN;
  409.  
  410.      REPEAT
  411.        ProcedureCalls;
  412.        UNTIL KbdKeyWaiting;
  413.  
  414.   DESCRIPTION
  415.       This routine uses the BIOS function call to determine if there are any
  416.       keys waiting in the buffer.  It is very similar to the Turbo function
  417.       KeyPressed.  
  418.  
  419.   SEE ALSO
  420.      KbdInputValue
  421.  
  422.   DEPENDS ON
  423.  
  424.   DIAGNOSTICS
  425.  
  426.   KNOWN RESTRICTIONS 
  427.  
  428.   PARTIALLY OBSOLETED BY
  429.      KeyPressed
  430.  
  431.   UPDATE HISTORY
  432.  
  433.  
  434. 
  435.  
  436.